<#assign title="Benchmark编辑页面">
<#include "/admin/inc/top.html"/>
<div class="main-content" id="main-content">
    <header class="header navbar bg-white shadow">
        <div class="btn-group tool-button">
            <a class="btn btn-primary navbar-btn" href="${base!}/private/fof/benchmark" data-pjax><i
                    class="fa fa-reply"></i> 返回</a>
        </div>
    </header>
    <section class="content">
        <div class="form-wrapper" style="min-height:500px;">
            <section class="panel panel-form">
                <form id="unitAddForm" role="form" class="form-horizontal parsley-form" data-parsley-validate
                      action="${base!}/private/fof/benchmark/editDo" method="post">
                    <input type="hidden" name="id" value="${benchmark.id}">
                    <div class="row mb10">
                        <div class="col-lg-12">
                            <div class="form-group">
                                <label for="name" class="col-sm-2 control-label">benchmark名称</label>

                                <div class="col-sm-8">
                                    <input type="text" id="name" class="form-control" name="name"
                                    data-parsley-required="true" placeholder="benchmark名称" value="${benchmark.name}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label for="windCode" class="col-sm-2 control-label">wind代码</label>

                                <div class="col-sm-8">
                                    <input type="text" id="windCode" class="form-control" name="windCode"
                                           data-parsley-required="true"  placeholder="wind代码" value="${benchmark.windCode}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label for="assetStrategyArr" class="col-sm-2 control-label">资产/策略配置</label>

                                <div class="col-sm-8">
                                    <select id="assetStrategyArr" class="form-control" name="assetStrategyArr">
                                        <optgroup label="资产" class="group-1">
                                            <#list assetInfoList as assetInfo>
                                                    <option value="${assetInfo.id}" <#if benchmark.assetStrategyId == assetInfo.id>selected</#if>>${assetInfo.name}</option>
                                            </#list>
                                        </optgroup>
                                        <optgroup label="策略" class="group-2">
                                            <#list strategyInfoList as strategy>
                                                    <option value="${strategy.id}" <#if benchmark.assetStrategyId == strategy.id>selected</#if>>${strategy.name}</option>
                                            </#list>
                                        </optgroup>
                                    </select>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <!--<div class="form-group">-->
                                <!--<label class="col-sm-2 control-label">类别</label>-->

                                <!--<div class="col-sm-8">-->
                                    <!--<input class="ichk" type="radio" name="typeId" <#if typeId == 1>checked</#if> value="1">资产-->
                                    <!--<input class="ichk" type="radio" name="typeId" <#if typeId == 2>checked</#if> value="2">策略-->
                                <!--</div>-->
                            <!--</div>-->
                        </div>
                    </div>
                    <div class="col-lg-3"></div>
                    <div class="col-lg-6">
                        <div class="form-group text-center">
                            <label></label>

                            <div>
                                <button class="btn btn-primary btn-block btn-lg btn-parsley"
                                        data-loading-text="正在提交...">提 交
                                </button>
                            </div>
                        </div>
                    </div>
                </form>
            </section>

        </div>
        <a class="exit-offscreen"></a>
    </section>
</div>
<script language="JavaScript">

    $(document).ready(function () {
        //initTreeView();
        $('#unitAddForm').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, form, options) {
                form.find("button:submit").button("loading");
            },
            success: function (data, statusText, xhr, form) {
                if (data.code == 200) {
                    Toast.success(data.msg);
                } else {
                    Toast.error(data.msg);
                }
                form.find("button:submit").button("reset");
            }
        });
        $('#assetStrategyArr').multiselect();
    });
</script>
<#include "/admin/inc/bottom.html"/>